home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#23 (Aug 87)
/
library manager source
/
Lib Mgr Demo
next >
Wrap
Text File
|
1987-07-13
|
2KB
|
84 lines
PROGRAM LibMgrDemo;
{$I- Lightspeed Compiler Command}
USES
LibMgr;
VAR
TopFile : LmirHdl;
PROCEDURE InitThings;
BEGIN
InitGraf(@thePort); {create a grafport for the screen}
MoreMasters;
MoreMasters;
MoreMasters;
InitFonts;
InitWindows;
InitMenus;
TEInit;
InitDialogs(NIL);
FlushEvents(everyEvent, 0);
InitCursor;
END;
PROCEDURE SetUpThings;
BEGIN
OpenLib(TopFile, 'Application Default Library'); {When program boots}
OpenLinkedLib(TopFile, 'User Default Library'); {When program boots}
END;
PROCEDURE DisplayMsg2;
VAR
p1, p2, p3, p4 : str80;
status : ARRAY[0..3] OF str80;
x : integer;
BEGIN
Status[0] := 'Open';
Status[1] := 'Closed';
Status[3] := 'Not Found';
x := Ord(TopFile^^.status);
p1 := Concat(TopFile^^.filename, ' is ', Status[x], '. ');
x := Ord(TopFile^^.next^^.status);
p2 := Concat(TopFile^^.next^^.filename, ' is ', Status[x], '. ');
p3 := ' ';
p4 := 'Would you like a nice cool glass of lemonade? ';
ParamText(p1, p2, p3, p4);
x := CautionAlert(301, NIL);
END;
PROCEDURE DisplayMsg;
VAR
next : LmirHdl;
newRect : Rect;
BEGIN
SetRect(newRect, 80, 40, 430, 200);
SetTextRect(newRect);
ShowText;
next := TopFile;
REPEAT
writeln(' The File ', next^^.filename, ' is ', next^^.status);
next := next^^.next;
UNTIL next = topfile;
Writeln(' Press mouse button to close files and exit');
WHILE NOT button DO
;
END;
PROCEDURE CloseThings;
BEGIN
CloseLibList(TopFile);
END;
BEGIN
InitThings;
SetUpThings;
DisplayMsg;
CloseThings;
END.